package face.pay.api.version.server.impl;

import face.pay.dao.AppVersionDao;
import face.pay.entity.AppVersion;
import face.pay.util.ResultMessage;
import face.pay.api.version.server.IAppVersionService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @Auther: zkj
 * @Date: 2019/8/20 15:39
 * @Description:
 */

@Service
@Slf4j
public class AppVersionServiceImpl implements IAppVersionService {

    @Autowired
    AppVersionDao appVersionDao;

    @Override
    public ResultMessage getAppVersion() {

        List<AppVersion> list =  this.appVersionDao.getVersion();
        AppVersion appVersion =  null;
        if(list.size()>=1){
            appVersion =   list.get(0);
        }
        return ResultMessage.createSuccess(appVersion);
    }
}
